package com.dream.testtubebaby_doctor.adapter;

import java.util.List;

import android.content.Context;

import com.dream.testtubebaby_doctor.R;
import com.dream.testtubebaby_doctor.data.AddToldData;
import com.dream.testtubebaby_doctor.utils.ViewHolder;

public class AddToldAdapter extends CommonAdapter<AddToldData> {

	public AddToldAdapter(Context context, List<AddToldData> mDatas,
			int itemLayoutId) {
		super(context, mDatas, itemLayoutId);
	}

	public void setDatas(List<AddToldData> mDatas) {
		this.mDatas.clear();
		this.mDatas.addAll(mDatas);
	}

	public void addAll(List<AddToldData> mDatas) {
		this.mDatas.addAll(mDatas);
	}

	@Override
	public void convert(final ViewHolder helper, final AddToldData item) {
		String title = mContext.getResources().getString(R.string.add_told_remind_message,
				item.getFromtime(), item.getTotime(), item.getStepname()) + " " + item.getDrug() + " " + item.getHowmuch();
		helper.setText(R.id.add_told_text, title);
		// CharSequence time_string = DateUtils.getRelativeTimeSpanString(
		// item.getTime(), System.currentTimeMillis(),
		// DateUtils.MINUTE_IN_MILLIS, DateUtils.FORMAT_ABBREV_RELATIVE);
		//
		// helper.setText(R.id.chat_time_tv, time_string.toString());
		// helper.setText(R.id.chat_content_tv, item.getContent());
	}
}
